package huang.homework16;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class BaseDao {
	String driver="com.mysql.jdbc.Driver";
	String database="jiuzhuanxiaomo";
	String userName="root";
	String pwd="root";
	String url="jdbc:mysql://localhost:3306/"+database+"?useUnicode=true&characterEncoding=utf-8";
	Connection con=null;
	public Connection getCon(){
	try{
		Class.forName(driver);
		con=DriverManager.getConnection(url,userName,pwd);

	}catch(ClassNotFoundException e){
		e.printStackTrace();
	}catch(SQLException e){
		e.printStackTrace();
	}return con;
}
}

